package cn.zzh.dao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class AccDaoImp  implements AccDao{
    @Autowired
    private JdbcTemplate jdbcTemplate;

    @Override
    public void outAcc(String name, Double money) {
        String sql="update account set money =money-? where name=?";
        jdbcTemplate.update(sql,money,name);
    }

    @Override
    public void inAcc(String name, Double money) {
        String sql="update account set money = money +? where name=?";
        jdbcTemplate.update(sql,money,name);
    }
}
